On-demand caching in a WAN separated distributed file system or clustered file system cache

ABSTRACT

A mechanism is provided in a data processing system for on-demand caching in a wide area network (WAN) separated distributed file system or clustered file system. The mechanism monitors file access by a plurality of cache sites in the WAN separated distributed file system or clustered file system. The mechanism identifies access patterns by cache sites. The mechanism shares the access patterns with the plurality of cache sites. A given cache site within the plurality of cache sites combines the access patterns with local access information and identifies files to pre-fetch based on the combined information.

BACKGROUND

The present application relates generally to an improved data processingapparatus and method and more specifically to mechanisms for on-demandcaching in a Wide Area Network (WAN) separated distributed file systemor clustered file system cache.

Architectures exist for achieving wide area network (WAN) caching. Ahome site may be a general parallel file system (GPFS) or any other filesystem that is network file system (NFS) exported. Multiple cache sitesconnect to the home site over the network. Multiple cache sites can NFSmount the home NFS exports. Only one cache site is permitted to write tothe files in the cache for a particular NFS export. The other sites areread-only cache sites and can see updates from the home site and pullthe updates in to the cache site. However, cache sites cannot send anywrites or updates to files and directories to the home site. Multiplecache sites may be the single writer for different NFS exports from thehome site.

SUMMARY

In one illustrative embodiment, a method, in a data processing system,is provided for on-demand caching in a separated distributed file systemor clustered file system. The method comprises monitoring file access bya plurality of cache sites in the parallel file system. The methodfurther comprises identifying access patterns by cache sites. The methodfurther comprises sharing the access patterns with the plurality ofcache sites. A given cache site within the plurality of cache sitescombines the access patterns with local access information andidentifies files to schedule pre-fetch based on the combinedinformation.

In other illustrative embodiments, a computer program product comprisinga computer useable or readable medium having a computer readable programis provided. The computer readable program, when executed on a computingdevice, causes the computing device to perform various ones of, andcombinations of, the operations outlined above with regard to the methodillustrative embodiment.

In yet another illustrative embodiment, a system/apparatus is provided.The system/apparatus may comprise one or more processors and a memorycoupled to the one or more processors. The memory may compriseinstructions which, when executed by the one or more processors, causethe one or more processors to perform various ones of, and combinationsof, the operations outlined above with regard to the method illustrativeembodiment.

These and other features and advantages of the present invention will bedescribed in, or will become apparent to those of ordinary skill in theart in view of the following detailed description of the exampleembodiments of the present invention.

BRIEF DESCRIPTION OF THE SEVERAL VIEWS OF THE DRAWINGS

The invention, as well as a preferred mode of use and further objectivesand advantages thereof, will best be understood by reference to thefollowing detailed description of illustrative embodiments when read inconjunction with the accompanying drawings, wherein:

FIG. 1 depicts a pictorial representation of an example distributed dataprocessing system in which aspects of the illustrative embodiments maybe implemented;

FIG. 2 is a block diagram of an example data processing system in whichaspects of the illustrative embodiments may be implemented;

FIG. 3 depicts an example WAN separated Distributed File System orclustered file system in which aspects of the illustrative embodimentsmay be implemented;

FIG. 4 depicts a home site determining file activity in accordance withan illustrative embodiment;

FIG. 5 depicts sharing analytics and statistics and pre-fetching basedon the information in a WAN separated Distributed File System orclustered the system with on-demand caching in accordance with anillustrative embodiment;

FIG. 6 is a flowchart illustrating operation of a cache site withon-demand caching in a WAN separated Distributed File System orclustered file system in accordance with an illustrative embodiment;

FIG. 7 is a flowchart illustrating operation of a home site foron-demand caching in a WAN separated Distributed File System orclustered file system in accordance with an illustrative embodiment;

FIG. 8 is a flowchart illustrating operation of a cache site schedulingpre-fetching in accordance with an illustrative embodiment; and

FIG. 9 is a flowchart illustrating operation of a cache site performingstatistical analysis of access information in accordance with anillustrative embodiment.

DETAILED DESCRIPTION

The illustrative embodiments provide a mechanism for on-demand cachingin a WAN separated Distributed File System or clustered file system. Themechanism categorizes files that have been used actively during a timewindow or have multiple users over a period of time as active files. Thetime window or the period of time may be fixed or variable depending onthe granularity desired. The mechanism may use multiple time windows inwhich the same file or a number of different files may become active.

The home site may be at a central location. The home site is aware ofwhich files are active as it general sees most of the writes anduncached reads. The home site is also in a position to perform certainstatistical analysis. For example, over a period of several days, weeks,or months the home is in a position to determine which files start tobecome active, peak, and then become quiescent at which point in time.The home site collates this information and feeds it to the cache sitesso they can perform targeted pre-population/pre-fetching of the files.Based on the information provided, the cache sites can reducerevalidation intervals for particular files. For a particularly activefile, the home site may send a callback to the cache site when a writecomes in.

The illustrative embodiments may be utilized in many different types ofdata processing environments. In order to provide a context for thedescription of the specific elements and functionality of theillustrative embodiments, FIGS. 1 and 2 are provided hereafter asexample environments in which aspects of the illustrative embodimentsmay be implemented. It should be appreciated that FIGS. 1 and 2 are onlyexamples and are not intended to assert or imply any limitation withregard to the environments in which aspects or embodiments of thepresent invention may be implemented. Many modifications to the depictedenvironments may be made without departing from the spirit and scope ofthe present invention.

FIG. 1 depicts a pictorial representation of an example distributed dataprocessing system in which aspects of the illustrative embodiments maybe implemented. Distributed data processing system 100 may include anetwork of computers in which aspects of the illustrative embodimentsmay be implemented. The distributed data processing system 100 containsat least one network 102, which is the medium used to providecommunication links between various devices and computers connectedtogether within distributed data processing system 100. The network 102may include connections, such as wire, wireless communication links, orfiber optic cables.

In the depicted example, server 104 and server 106 are connected tonetwork 102 along with storage unit 108. In addition, clients 110, 112,and 114 are also connected to network 102. These clients 110, 112, and114 may be, for example, personal computers, network computers, or thelike. In the depicted example, server 104 provides data, such as bootfiles, operating system images, and applications to the clients 110,112, and 114. Clients 110, 112, and 114 are clients to server 104 in thedepicted example. Distributed data processing system 100 may includeadditional servers, clients, and other devices not shown.

In the depicted example, distributed data processing system 100 is theInternet with network 102 representing a worldwide collection ofnetworks and gateways that use the Transmission ControlProtocol/Internet Protocol (TCP/IP) suite of protocols to communicatewith one another. At the heart of the Internet is a backbone ofhigh-speed data communication lines between major nodes or hostcomputers, consisting of thousands of commercial, governmental,educational and other computer systems that route data and messages. Ofcourse, the distributed data processing system 100 may also beimplemented to include a number of different types of networks, such asfor example, an intranet, a local area network (LAN), a wide areanetwork (WAN), or the like. As stated above, FIG. 1 is intended as anexample, not as an architectural limitation for different embodiments ofthe present invention, and therefore, the particular elements shown inFIG. 1 should not be considered limiting with regard to the environmentsin which the illustrative embodiments of the present invention may beimplemented.

FIG. 2 is a block diagram of an example data processing system in whichaspects of the illustrative embodiments may be implemented. Dataprocessing system 200 is an example of a computer, such as client 110 inFIG. 1, in which computer usable code or instructions implementing theprocesses for illustrative embodiments of the present invention may belocated.

In the depicted example, data processing system 200 employs a hubarchitecture including north bridge and memory controller hub (NB/MCH)202 and south bridge and input/output (I/O) controller hub (SB/ICH) 204.Processing unit 206, main memory 208, and graphics processor 210 areconnected to NB/MCH 202. Graphics processor 210 may be connected toNB/MCH 202 through an accelerated graphics port (AGP).

In the depicted example, local area network (LAN) adapter 212 connectsto SB/ICH 204. Audio adapter 216, keyboard and mouse adapter 220, modem222, read only memory (ROM) 224, hard disk drive (HDD) 226, CD-ROM drive230, universal serial bus (USB) ports and other communication ports 232,and PCI/PCIe devices 234 connect to SB/ICH 204 through bus 238 and bus240. PCI/PCIe devices may include, for example, Ethernet adapters,add-in cards, and PC cards for notebook computers. PCI uses a card buscontroller, while PCIe does not ROM 224 may be, for example, a flashbasic input/output system (BIOS).

HDD 226 and CD-ROM drive 230 connect to SB/ICH 204 through bus 240. HDD226 and CD-ROM drive 230 may use, for example, an integrated driveelectronics (IDE) or serial advanced technology attachment (SATA)interface. Super I/O (SIO) device 236 may be connected to SB/ICH 204.

An operating system runs on processing unit 206. The operating systemcoordinates and provides control of various components within the dataprocessing system 200 in FIG. 2. As a client, the operating system maybe a commercially available operating system such as Microsoft Windows 7(Microsoft and Windows are trademarks of Microsoft Corporation in theUnited States, other countries, or both). An object-oriented programmingsystem, such as the Java programming system, may run in conjunction withthe operating system and provides calls to the operating system fromJava programs or applications executing on data processing system 200(Java is a trademark of Oracle and/or its affiliates).

As a server, data processing system 200 may be, for example, an IBM®eServer™ System P® computer system, running the Advanced InteractiveExecutive operating system or the LINUX operating system (IBM, eServer,System p, and AIX are trademarks of International Business MachinesCorporation in the United States, other countries, or both, and LINUX isa registered trademark of Linux Torvalds in the United States, othercountries, or both). Data processing system 200 may be a symmetricmultiprocessor (SMP) system including a plurality of processors inprocessing unit 206. Alternatively, a single processor system may beemployed.

Instructions for the operating system, the object-oriented programmingsystem, and applications or programs are located on storage devices,such as HDD 226, and may be loaded into main memory 208 for execution byprocessing unit 206. The processes for illustrative embodiments of thepresent invention may be performed by processing unit 206 using computerusable program code, which may be located in a memory such as, forexample, main memory 208, ROM 224, or in one or more peripheral devices226 and 230, for example.

A bus system, such as bus 238 or bus 240 as shown in FIG. 2, may becomprised of one or more buses. Of course, the bus system may beimplemented using any type of communication fabric or architecture thatprovides for a transfer of data between different components or devicesattached to the fabric or architecture. A communication unit, such asmodem 222 or network adapter 212 of FIG. 2, may include one or moredevices used to transmit and receive data. A memory may be, for example,main memory 208, ROM 224, or a cache such as found in NB/MCH 202 in FIG.2.

Those of ordinary skill in the art will appreciate that the hardware inFIGS. 1 and 2 may vary depending on the implementation. Other internalhardware or peripheral devices, such as flash memory, equivalentnon-volatile memory, or optical disk drives and the like, may be used inaddition to or in place of the hardware depicted in FIGS. 1 and 2. Also,the processes of the illustrative embodiments may be applied to amultiprocessor data processing system, other than the SMP systemmentioned previously, without departing from the spirit and scope of thepresent invention.

Moreover, the data processing system 200 may take the form of any of anumber of different data processing systems including client computingdevices, server computing devices, a tablet computer, laptop computer,telephone or other communication device, a personal digital assistant(PDA), or the like. In some illustrative examples, data processingsystem 200 may be a portable computing device that is configured withflash memory to provide non-volatile memory for storing operating systemfiles and/or user-generated, data, for example. Essentially, dataprocessing system 200 may be any known or later developed dataprocessing system without architectural limitation.

Returning to FIG. 1, distributed data processing system 100 may employ ageneral parallel file system (GPFS) in which one node, such as server104 is a home site, and other nodes, such as clients 110, 112, 114 andserver 106, may be cache sites. FIG. 3 depicts an example WAN separatedDistributed File System or clustered file system in which aspects of theillustrative embodiments may be implemented. Home site 310 connects tocache sites 301-306. Cache sites 301-305 are read-only sites for one ormore file mounts, and cache site 306 is a write cache for the filemount.

The WAN separated distributed file system or clustered file system cacheis based on the concept of on-demand caching. When a file is accessed,there are three different scenarios that are possible:

-   -   1. The file has been fetched recently, In this model, there is        an access to a particular file. If the file already exists at        the cache site and the file was stored at the cache site within        a predetermined interval called the revalidation interval, then        the file may be accessed directly in the cache, making it a        local access, which is very fast.    -   2. The file has not been fetched recently. If the file exists at        the cache site but the revalidation interval has expired since        the file was stored at the cache site, the cache site performs a        revalidation process against the home site copy. The cache site        then performs a lookup to the home site to obtain modified time        and change time attributes, if the modified time and change time        of the file at the home site differ from the values of the file        at the cache site, then the file is re-fetched from the home        site to the cache site.    -   3. The file does not exist at the cache site. If the file does        not exist at the cache site, the cache site fetches the file        from the home site.

Certainly, in the latter two cases, the application experiences anaccess latency that is directly proportional to the file size and thebandwidth of the link to the home site.

A WAN separated Distributed File System or clustered file system withon-demand caching may experience two cases: cold access to a file andstale access. Stale access is when the cache site determines that thefile is modified at the home site and must be re-fetched. The time forfirst access or stale access to a file within certain constraints isdirectly proportional to the file size and bandwidth of the link. Thismay be a significant overhead in the case of a slow or limited bandwidthlink. Pre-population may alleviate the first access problem to someextent; however, when a file is not accessed for a long time, the filemust be re-fetched from the home site, again introducing a delay.

Some solutions may be based on pre-population and file-basedpre-fetching. Here pre-population means fetching the whole file from thehome site to the cache site prior to it being needed. Pre-populationwill re-fetch the entire file in the cache if it is stale with respectto the home version. Pre-fetching means fetching portions of the filefrom the home before they are needed. Pre-fetching includes re-fetching,i.e. updating stale portions of a file from the home when the cacheportions of these files are not in sync with the home portions of thesefiles. Pre-population may help alleviate the cost of first access;however, it typically is executed by an administrator and is not anautomated method of reducing first access time. It also cannot adaptdynamically to changes in access patterns, unless the administratormodifies the pre-population scheme. Generally, pre-population is aone-time action to bring in data to an empty cache. File datapre-fetching does not solve the problem of the time lag/delay on firstaccess, or subsequent state access. Rather, it solves the problem ofhaving the data for other parts of the file before they are needed afterfirst access.

The mechanisms of the illustrative embodiments use the concept of activefiles, which may be categorized as those files that have either beenused actively during a time window or have multiple users over a periodof time. The time window or the period of time may be fixed or variabledepending on a desired granularity. Alternatively, the mechanisms mayuse multiple time windows in which the same file or a number ofdifferent files may become active.

In a WAN separated Distributed File System or clustered file system withon-demand caching, the home site generally is at a central location. Thehome site is aware of which files are active as it generally sees mostof the file writes and uncached reads. The home site also is in aposition to perform certain statistical analysis. For example, over aperiod of several days, weeks, or months, the home site is in a positionto determine which files start becoming active, peak, and then becomequiescent, at which points in time. The home site can collate thisinformation and feed it to the cache sites, so they can perform targetedpre-population/pre-fetching of the files when needed. Based on theinformation provided, the cache site can also reduce its revalidationinterval for a particular file. For a particularly active file, the homesite can send a callback to the cache site whenever a write comes in.

The home site determines the “heat” of a file or set of files. The homesite then provides that information to the cache sites. For very activefiles, the home site may provide a callback to the cache site.

FIG. 4 depicts a home site determining file activity in accordance withan illustrative embodiment. Cache site 401 receives a write for file F402. Home site 410 maintains statistics 403 of the hotness of F. Thehotness of a file or set of files may be based on writes coming to thefile and also on the reads from different cache sites and also havingmultiple users over a period of time. Also, different files may beactive during different periods. Home site 410 stores and collates thisinformation so as to determine access patterns.

Home site 410 may be the target of several different single-writer cachesites. Home site 410 can correlate information across mount points ordirectories. For example, a first file in a first mount point directorymay be written to at the same time that a second file in a second mountpoint directory is written to. Also, it is important to determinesharing patterns of files. For example, a write to a file may befollowed by a read from a set of files and then followed by a write fromanother node. The information about the sharing patterns may becontinuously evolving. The history of the access patterns must bestored. For example, a particular file may be heavily accessed andmodified between 2:00 PM and 3:00 PM on Wednesday. Information like thisis valuable and may be used to great advantage by the cache sites.

FIG. 5 depicts sharing analytics and statistics and pre-fetching basedon the information in a WAN separated Distributed File System orclustered file system with on-demand caching in accordance with anillustrative embodiment. Periodically, the home site 510 shares theaccess patterns and activeness with the different cache sites 501, 502,506. The cache sites 501, 502, 506 combine the pattern informationcoming from home site 510 with the information they possess locallyabout the access patterns of the clients to which they are connected.The cache sites 501, 502, 506 then attempt to pre-fetch or schedulepre-fetching the files that are most likely to be accessed.

On occasion, there may be a file that may be very active and beingheavily accessed. This information may not have been made available tothe other cache sites because it is a recent pattern. In accordance withan example embodiment, a provision may be made to install a look thatwill callback or callout to the cache site to inform the cache site thatit may need to pre-fetch the data to the cache to offset the on-demandpenalty of the file.

Statistical analysis involves weighing data on heuristically patternsspread across different cache site to help schedule predictiveprefetching of tiles. One example: If User A accesses a Data X for agiven event from a given cache site; and through statistical analysisbased on heuristics it suggests that Data Y be accessed by the user fromthe same cache in a predetermined interval of time—thennominating/predicting Data Y for pre-fetch (stating it very active fornext predetermined interval of time) for that particular cache duringthat particular event and time helps make caching more effective.

Here is one such example for the embodiment to help describe itsimplementation.

For algorithm A, consider the following nomenclature:

-   -   R(x,t,c)—Read to a particular data element x at time t, where t        is the time at a central site designated as the home site and c        is a cache cluster ID,    -   W(x,t,c)—Write to a particular data element x at time t, where t        is the time at a central site designated as the home site and c        is a cache cluster ID.    -   T(t,x)—T is a two dimensional table indexed along the x-axis by        time running from 0-interval P (where P is a predetermined        value, e.g., 24 hours) and a granularity G (e.g., 1 second).        Each element in T is a linked list of R(x,t,c) and W(x,t,c)        elements. These elements are in no particular order.    -   T′(t,x)—T″ is a two dimensional table similar in structure to T.        The difference between T and T′ is that each element in T′ is a        bunch of linked list of R(x,t,c) and W(x,t,c) elements (one        linked list for each data element x), where each list is sorted        on time of arrival t.    -   T″(t,x)—T″ is similar to T′ with the addition of linkages        between graph elements. T″ is persistent and helps build the        heuristics and evolution.    -   M—Consolidation time interval.    -   D—Consolidation interval granularity.    -   G—Time Interval Granularity.    -   P—Particular Recurring Interval in Granularity G.

The algorithm proceeds as follows:

-   -   Step S: At every time interval M, do the following steps at the        central site:        -   a. Transform T to a new table T′ with granularity D, by            combining D/G adjacent elements along the x-axis such that            we have lists of read/write sequences to the same data            element x in sequential time.        -   b. Further transform T′ to T″ such that:            -   i. If any particular element in the graph 17 with data                element x has only reads, create a link (if it exists)                to the preceding write to x.            -   ii. if any particular table entry with data entry x only                has writes, create a link to the next set of reads                (could be in another grid element).

Algorithm A is merely an implementation detail and is not meant to limitthe illustrative embodiments. A person skilled in the art can easilyreplace Step S with other known statistical algorithms like StatisticalInference, Markov etc.

In the general I/O path at the central site/home:

-   -   For an incoming W(x,t,c):        -   i. Update existing table T with information of Write in            appropriate grid entry, depending on time interval in which            it lies.        -   ii. Using table T″, determine subsequent predicted Reads            from other cache clusters to the data element x (if they            exist). If a subsequent Read exists, push Read to that cache            cluster site.

For in incoming Read(x,t,c):

-   -   i. Update existing table T with information of Read in        appropriate grid entry, depending on time interval in which it        ties.

Algorithm B: The central site or home site shares the contents of TableT″ with the cache sites. The cache sites determine, based on theiraccess patterns, which data elements they want to pull in.

Algorithm C: For very active files whose access pattern is notrepresented in T″, the central site or home site sends a callback to thecache sites. The cache sites then decide if they want to pull in thefile.

As will be appreciated by one skilled in the art, the present inventionmay be embodied as a system, method, or computer program product.Accordingly, aspects of the present invention may take the form of anentirely hardware embodiment, an entirely software embodiment (includingfirmware, resident software, micro-code, etc.) or an embodimentcombining software and hardware aspects that may all generally bereferred to herein as a “circuit,” “module,” or “system.” Furthermore,aspects of the present invention may take the form of a computer programproduct embodied in any one or more computer readable medium(s) havingcomputer usable program code embodied thereon.

Any combination of one or more computer readable medium(s) may beutilized. The computer readable medium may be a computer readable signalmedium or a computer readable storage medium. A computer readablestorage medium may be, for example, but not limited to, an electronic,magnetic, optical, electromagnetic, infrared, or semiconductor system,apparatus, device, or any suitable combination of the foregoing. Morespecific examples (a non-exhaustive list) of the computer readablestorage medium would include the following: an electrical connectionhaving one or more wires, a portable computer diskette, a hard disk, arandom access memory (RAM), a read-only memory (ROM), an erasableprogrammable read-only memory (EPROM or Flash memory), an optical fiber,a portable compact disc read-only memory (CDROM), an optical storagedevice, a magnetic storage device, or any suitable combination of theforegoing. In the context of this document, a computer readable storagemedium may be any tangible medium that can contain or store a programfor use by or in connection with an instruction execution system,apparatus, or device.

A computer readable signal medium may include a propagated data signalwith computer readable program code embodied therein, for example, in abaseband or as part of a carrier wave. Such a propagated signal may takeany of a variety of forms, including, but not limited to,electro-magnetic, optical, or any suitable combination thereof. Acomputer readable signal medium may be any computer readable medium thatis not a computer readable storage medium and that can communicate,propagate, or transport a program for use by or in connection with aninstruction execution system, apparatus, or device.

Computer code embodied on a computer readable medium may be transmittedusing any appropriate medium, including but not limited to wireless,wireline, optical fiber cable, radio frequency (RF), etc., or anysuitable combination thereof.

Computer program code for carrying out operations for aspects of thepresent invention may be written in any combination of one or moreprogramming languages, including an object oriented programming languagesuch as Java™, Smalltalk™, C++, or the like, and conventional proceduralprogramming languages, such as the “C” programming language or similarprogramming languages. The program code may execute entirely on theuser's computer, partly on the user's computer, as a stand-alonesoftware package, partly on the user's computer and partly on a remotecomputer, or entirely on the remote computer or server. In the tatterscenario, the remote computer may be connected to the user's computerthrough any type of network, including a local area network (LAN) or awide area network (WAN), or the connection may be made to an externalcomputer (for example, through the Internet using an Internet ServiceProvider).

Aspects of the present invention are described below with reference toflowchart illustrations and/or block diagrams of methods, apparatus(systems) and computer program products according to the illustrativeembodiments of the invention. It will be understood that each block ofthe flowchart illustrations and/or block diagrams, and combinations ofblocks in the flowchart illustrations and/or block diagrams, can beimplemented by computer program instructions. These computer programinstructions may be provided to a processor of a general purposecomputer, special purpose computer, or other programmable dataprocessing apparatus to produce a machine, such that the instructions,which execute via the processor of the computer or other programmabledata processing apparatus, create means for implementing thefunctions/acts specified in the flowchart and/or block diagram block orblocks.

These computer program instructions may also be stored in a computerreadable medium that can direct a computer, other programmable dataprocessing apparatus, or other devices to function in a particularmanner, such that the instructions stored in the computer readablemedium produce an article of manufacture including instructions thatimplement the function/act specified in the flowchart and/or blockdiagram block or blocks.

The computer program instructions may also be loaded onto a computer,other programmable data processing apparatus, or other devices to causea series of operational steps to be performed on the computer, otherprogrammable apparatus, or other devices to produce a computerimplemented process such that the instructions which execute on thecomputer or other programmable apparatus provide processes forimplementing the functions/acts specified in the flowchart and/or blockdiagram block or blocks.

FIG. 6 is a flowchart illustrating operation of a cache site withon-demand caching in a WAN separated Distributed File System orclustered file system in accordance with an illustrative embodiment.Operation begins when the cache site experiences a file access by aclient (block 600). The cache site determines whether the file is in itslocal cache (block 601). If the file is not in the local cache, thecache site fetches the file from the home site (block 602), andoperation ends (block 603).

If the cache site determines the file is in local cache in block 601,the cache site determines whether the file is recently fetched (block604). The cache site determines whether the file was fetched within apredetermined time threshold. If the file is recently fetched, the cachesite accesses the file directly in the local cache (block 605), andoperation ends.

If the cache site determines the file is not recently fetched in block604, the cache site performs revalidation against the home copy (block607). To perform revalidation, the cache site obtains the modified timeand change time attributes of the file from the home site and comparesthem to the same attributes of the copy of the file in the local cache.The cache site determines whether the time attributes of the local filematch the time attributes of the file at the home site (block 608). Ifthe attributes do not match, the cache site fetches the file from thehome site (block 602), and operation ends. If the attributes match inblock 608, the cache site access the file directly in the local cache(block 605), and operation ends (Block 606).

FIG. 7 is a flowchart illustrating operation of a home site foron-demand caching in a WAN separated Distributed File System orclustered file system in accordance with an illustrative embodiment.Operation begins (block 700). The home site monitors file accesses(block 701) and shares access patterns with cache sites (block 702). Theaccess patterns may be shared as table T″.

The home site performs analysis to identify very active files (block703). This analysis may identify files that have been used activelyduring a predetermined time window and/or files that have multiple usersover a period of time. The time window and period of time may be fixedor variable depending on the granularity desired. The home site mayperform statistical analysis block 703 based on table T″, as describedabove. The home site then determines whether one or more active filesare identified (block 704). If active files are identified, the homesite informs the cache site(s) of the identified active file(s) (block705), and operation ends (block 706). If the home site does not detectactive files in block 704, then operation ends. The home site may repeatthe operation of FIG. 7 periodically to continuously provide informationfor pre-fetch scheduling to the cache sites.

FIG. 8 is a flowchart illustrating operation of a cache site schedulingpre-fetching in accordance with an illustrative embodiment. Operationbegins (block 800), and the cache site shares access patterns with thehome site (block 801). In block 801, the cache site may receive tableT″, which identifies reads and writes for a predetermined period oftime, P. The cache site combines access information from the home sitewith local access information (block 802). The cache site then performsanalysis to identify files to pre-fetch, generate pre-fetch schedule,and set revalidation intervals (block 803). Thereafter, operation ends(block 804).

FIG. 9 is a flowchart illustrating operation of a cache site performingstatistical analysis of access information in accordance with anillustrative embodiment. Operation begins (block 900), and the home sitereceives an activity table, T, with linked lists of read access andlinked lists of write accesses (block 901), T(t,x) is a two dimensionaltable indexed along the x-axis by time running from 0-interval P (whereP is a predetermined value, e.g., 24 hours) and a granularity G (e.g., 1second). Each element in T is a linked list of R(x,t,c) and W(x,t,c)elements. These elements are in no particular order. The home site thentransforms the activity table, T, into a table of sorted linked lists,T′ (block 902). T′(t,x) is a two dimensional table similar in structureto T. The difference between T and T′ is that each element in T′ is abunch of linked list of R(x,t,c) and W(x,t,c) elements (one linked listfor each data element x), where each list is sorted on time of arrivalt.

The home site then determines whether any element in T′ has only reads(block 903). If an element has only reads, the home site creates a linkto the preceding write (block 904). Thereafter, or if no element in Thas only reads in block 903, the home site determines whether anyelement in T′ has only writes (block 905). If an element has onlywrites, the home site creates a link to the next set of reads (block906). The operation of blocks 903-906 result in an updated activitytable, T″. T″(t,x) is similar to T′ with the addition of linkagesbetween graph elements. T″ is persistent and helps build the heuristicsand evolution.

Thereafter, or if no element in has only writes in block 905, the homesite determines whether an incoming write is encountered (block 907). Ifa write is encountered for a data element at the home site, the homesite updates the activity table, T (block 908). The home site then usesT″ to determine subsequent predicted reads from one or more other cacheclusters to the data element (block 909). The home site pushes the dataelement to the one or more cache clusters (block 910). Thereafter,operation returns to block 902 to transform the activity table into atable of sorted linked lists.

If the home site does not encounter a write in block 907, the home sitedetermines whether an incoming read is encountered (block 911). If aread is encountered for a data element at the home site, the home siteupdates the activity table, T (block 912). Thereafter, or if the homesite does not encounter a read in block 911, operation returns to block902 to transform the activity table into a table of sorted linked lists.

The flowchart and block diagrams in the figures illustrate thearchitecture, functionality, and operation of possible implementationsof systems, methods and computer program products according to variousembodiments of the present invention. In this regard, each block in theflowchart or block diagrams may represent a module, segment, or portionof code, which comprises one or more executable instructions forimplementing the specified logical function(s). It should also be notedthat, in some alternative implementations, the functions noted in theHock may occur out of the order noted in the figures. For example, twoblocks shown in succession may, in fact, be executed substantiallyconcurrently, or the blocks may sometimes be executed in the reverseorder, depending upon the functionality involved. It will also be notedthat each block of the block diagrams and/or flowchart illustration, andcombinations of blocks in the block diagrams and/or flowchartillustration, can be implemented by special purpose hardware-basedsystems that perform the specified functions or acts, or combinations ofspecial purpose hardware and computer instructions.

Thus, the illustrative embodiments provide mechanisms for on-demandcaching in a WAN separated Distributed File System or clustered filesystem. The mechanism reduces the penalty of first access. The expectedreduction will depend on the accuracy of the prediction logic. Thereduction will also depend on the periodicity of the sharing informationbetween the cache sites and the home site. For at least some of thefirst or cold accesses, time will be equivalent to local access. Themechanisms may also be used for network attached storage solutions, suchas network file systems.

As noted above, it should be appreciated that the illustrativeembodiments may take the form of an entirely hardware embodiment, anentirely software embodiment or an embodiment containing both hardwareand software elements. In one example embodiment, the mechanisms of theillustrative embodiments are implemented in software or program code,which includes but is not limited to firmware, resident software,microcode, etc.

A data processing system suitable for storing and/or executing programcode will include at least one processor coupled directly or indirectlyto memory elements through a system bus. The memory elements can includelocal memory employed during actual execution of the program code, bulkstorage, and cache memories which provide temporary storage of at leastsome program code in order to reduce the number of times code must beretrieved from bulk storage during execution.

Input/output or I/O devices (including but not limited to keyboards,displays, pointing devices, etc.) can be coupled to the system eitherdirectly or through intervening I/O controllers. Network adapters mayalso be coupled to the system to enable the data processing system tobecome coupled to other data processing systems or remote printers orstorage devices through intervening private or public networks. Modems,cable modems and Ethernet cards are just a few of the currentlyavailable types of network adapters.

The description of the present invention has been presented for purposesof illustration and description, and is not intended to be exhaustive orlimited to the invention in the form disclosed. Many modifications andvariations will be apparent to those of ordinary skill in the art. Theembodiment was chosen and described in order to best explain theprinciples of the invention, the practical application, and to enableothers of ordinary skill in the art to understand the invention forvarious embodiments with various modifications as are suited to theparticular use contemplated.

What is claimed is:
 1. A computer program product comprising anon-transitory computer readable storage medium having a computerreadable program stored therein, wherein the computer readable program,when executed on a computing device causes the computing device to:monitor, by a home site in a separated distributed file system orclustered file system, file access by a plurality of cache sites in theseparated distributed file system or clustered file system; record, bythe home site, file accesses in an activity table, wherein the activitytable is a two-dimensional table indexed by time over a predeterminedinterval P and a granularity G, wherein each element in the activitytable is a linked list of read and write elements; transform theactivity table into a sorted activity table wherein each element in thesorted activity table is a linked list of read and write elements sortedby time; convert the sorted activity table into a converted activitytable by creating a link to a preceding write for each element in thestored activity table having only reads and creating a link to a nextset of reads for each element in the sorted activity table having onlywrites; identify, by the home site and based on the converted activitytable, access patterns by cache sites; and share the access patternswith the plurality of cache sites, wherein a given cache site within theplurality of cache sites combines the access patterns with local accessinformation and identifies files to pre-fetch based on the combinedinformation.
 2. The computer program product of claim 1, wherein thehome site maintains statistics of file access patterns with respect tofiles in the separated distributed file system or clustered file system.3. The computer program product of claim 2, wherein the computerreadable program further causes the computing device to: performinganalysis to identify at least one active file; and responsive toidentifying at least one active file, informing at least one cache sitewithin the plurality of cache sites of the at least one active file,wherein the at least one cache site pre-fetches the at least one activefile.
 4. The computer program product of claim 1, wherein the givencache site performs analysis to identify files to pre-fetch.
 5. Thecomputer program product of claim 1, wherein the given cache siteperforms analysis to generate a pre-fetch schedule.
 6. The computerprogram product of claim 1, wherein the given cache site resets at leastone revalidation interval.
 7. The computer program product of claim 1,wherein sharing the access patterns comprises sending the convertedactivity table to the plurality of cache sites.
 8. The computer programproduct of claim 1, wherein the computer readable program further causesthe computing device to: responsive to receiving a write for a dataelement at the home site, determine subsequent predicted reads from atleast one cache site based on the converted activity table; and push thedata dement to the at least one cache site.
 9. The computer programproduct of claim 8, wherein determining subsequent predicted readscomprises weighing data on heuristic patterns across different cachesite to schedule predictive prefetching of files.
 10. The computerprogram product of claim 9, wherein determining subsequent predictedreads further comprises: responsive to a given user accessing a firstdata element from a given cache site, identifying a second data elementthat is likely to be accessed by the given user from the given cachesite in a predetermined interval of time and nominating the second dataelement for pre-fetching.
 11. The computer program product of claim 1,wherein the computer readable program is stored in a computer readablestorage medium in a data processing system and wherein the computerreadable program was downloaded over a network from a remote dataprocessing system.
 12. The computer program product of claim 1, whereinthe computer readable program is stored in a computer readable storagemedium in a server data processing system and wherein the computerreadable program is downloaded over a network to a remote dataprocessing system for use in a computer readable storage medium with theremote system.
 13. A method, in a data processing system, for on-demandcaching in a separated distributed file system or clustered file system,the method comprises: Monitoring file access by a plurality of cachesites in the separated distributed file system or clustered file system;recording file accesses in an activity table, wherein the activity tableis a two-dimensional table indexed by time over a predetermined intervalP and a granularity G, wherein each element in the activity table is alinked list of read and write elements; transforming the activity tableinto a sorted activity table wherein each element in the sorted activitytable is a linked list of read and write elements sorted by time;convert the sorted activity table into a converted activity table bycreating a link to a preceding write for each element in the storedactivity table having only reads and creating a link to a next set ofreads for each element in the sorted activity table having only writes;identifying, based on the converted activity table, access patterns bycache sites; and sharing the access patterns with the plurality of cachesites, wherein a given cache site within the plurality of cache sitescombines the access patterns with local access information andidentifies files to pre-fetch based on the combined information.
 14. Themethod of claim 13, wherein the home site maintains statistics of fileaccess patterns with respect to files in the separated distributed filesystem or clustered file system.
 15. The method of claim 14, furthercomprising: performing analysis to identify at least one active file;and responsive to identifying at least one active file, informing atleast one cache site within the plurality of cache sites of the at leastone active file, wherein the at least one cache site pre-fetches the atleast one active file.
 16. The method of claim 13, wherein the givencache site performs analysis to identify files to pre-fetch and generatea pre-fetch schedule.
 17. The method of claim 13, wherein the givencache site to reset at least one revalidation interval.
 18. The methodof claim 13, wherein sharing the access patterns comprises sending theconverted activity table to the plurality of cache sites.
 19. The methodof claim 13, further comprises: responsive to receiving a write for adata element at the home site, determine subsequent predicted reads fromat least one cache site based on the converted activity table; and pushthe data dement to the at least one cache site.
 20. An apparatus,comprising: a processor, and a memory coupled to the processor, whereinthe memory comprises instructions which, when executed by the processor,cause the processor to: monitor file access by a plurality of cachesites in the separated distributed file system or clustered file system;record file accesses in an activity table, wherein the activity table isa two-dimensional table indexed by time over a predetermined interval Pand a granularity G, wherein each element in the activity table is alinked list of read and write elements; transform the activity tableinto a sorted activity table wherein each element in the sorted activitytable is a linked list of read and write elements sorted by time;convert the sorted activity table into a converted activity table bycreating a link to a preceding write for each element in the storedactivity table having only reads and creating a link to a next set ofreads for each element in the sorted activity table having only writes;identify, based on the converted activity table, access patterns bycache sites; and share the access patterns with the plurality of cachesites, wherein a given cache site within the plurality of cache sitescombines the access patterns with local access information andidentifies files to pre-fetch based on the combined information.
 21. Theapparatus of claim 20, wherein the home site maintains statistics offile access patterns with respect to files in the separated distributedfile system or clustered file system, wherein instructions further causethe processor to: perform analysis to identify at least one active file;and responsive to identifying at least one active file, inform at leastone cache site within the plurality of cache sites of the at least oneactive file, wherein the at least one cache site pre-fetches the atleast one active file.
 22. The computer program product of claim 20,wherein the computer readable program further causes the computingdevice to: responsive to receiving a write for a data element at thehome site, determine subsequent predicted reads from at least one cachesite based on the converted activity table; and push the data dement tothe at least one cache site.